package com.nowc.month.m120;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class c {

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        int T = Integer.parseInt(br.readLine());
        while (T-- > 0) {
            solve();
        }
        out.flush();
        out.close();
        br.close();
    }

    static void solve() throws IOException {
         int n = Integer.parseInt(br.readLine());
         StringBuilder ans = new StringBuilder();
         if (n == 1) {
             out.println(1);
             return;
         }
        if (n == 2) {
            out.println(-1);
            return;
        }
         if ((n - 1) % 2 == 0) {
             for (int i = 1; i <= n; i++) {
                 ans.append(i).append(" ");
             }
             out.println(ans.toString());
             return;
         }
         for (int i = 1; i <= n - 3; i++) {
             ans.append(i).append(" ");
         }
         ans.append(n - 1).append(" ");
         ans.append(n - 2).append(" ");
         ans.append(n);
         out.println(ans);
    }
}
